package cn.com.bluemoon.daps.model.vo.group;

import cn.com.bluemoon.daps.model.entity.DapDataModelTable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.Size;

/**
 * @author Jarod.Kong
 */
@Data
public class ModelSimpleTableVo {
    private String id;

    @ApiModelProperty(value = "业务描述")
    @Size(max = 64, message = "业务描述不可以大于{max}")
    private String businessDesc;

    @ApiModelProperty(value = "表英文名")
    private String engName;

    @ApiModelProperty(value = "表中文名")
    private String name;

    @ApiModelProperty(value = "表所属的schema")
    private String tableSchema;

    public ModelSimpleTableVo(DapDataModelTable table) {
        if (table != null) {
            BeanUtils.copyProperties(table, this);
        }
    }
}
